// file: src/main/java/com/ny/mapper/DeviceMapper.java
package com.ny.mapper;

import com.ny.entity.Device;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface DeviceMapper {

    /**
     * 查询所有设备信息
     * @return 设备列表
     */
    @Select("SELECT * FROM device")
    List<Device> findAllDevices();

    /**
     * 根据设备名称查询设备信息
     * @param deviceName 设备名称
     * @return 设备列表
     */
    @Select("SELECT * FROM device WHERE device_name LIKE CONCAT('%', #{deviceName}, '%')")
    List<Device> findDevicesByName(String deviceName);

}
